package main

import (
	"log"
	"net/http"
	"strconv"
)

// 服务启动
func runServer()  {
	log.Println("正在注册路由...")
	// 文件展示服务
	http.Handle("/",  http.FileServer(http.Dir(uploadPath)))
	// 上传服务
	http.HandleFunc("/upload",uploadHandler)
	// 删除服务
	http.HandleFunc("/delete/",deleteHandler)
	// 文件更新
	http.HandleFunc("/update/",updateHandler)
	log.Println("已完成")
	log.Printf("http://%v:%v/ \n",hostName,port)
	if err:= http.ListenAndServe(":"+strconv.Itoa(port),nil);err !=nil{log.Fatal(err)}
}

